# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=slirp4netns
pkgver=1.1.4
pkgrel=0
pkgdesc="User-mode networking for unprivileged network namespaces"
url="https://github.com/rootless-containers/slirp4netns"
arch="all"
license="GPL-2.0-or-later"
makedepends="glib-dev libcap-dev libseccomp-dev libslirp-dev autoconf automake"
checkdepends="bash gzip jq iproute2 nmap-ncat"
subpackages="$pkgname-doc"
options="!check" # flaky tests
source="$pkgname-$pkgver.tar.gz::https://github.com/rootless-containers/slirp4netns/archive/v$pkgver.tar.gz"

check() {
	# needs tun module loaded
	make check-TESTS
}

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	./configure --prefix=/usr
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="a6a26c55bdd4f50e668f7feeee3cd1d077e1ca9bd5bad5bbb8c47b15d366af4b1f2900241bedcd5a974a7597f43b17f970662271ec1987fbb6291c50470fa0a8  slirp4netns-1.1.4.tar.gz"
